package com.chujie.chat.server;

import java.util.HashSet;
import java.util.Set;

import com.chujie.chat.model.LoginInfo;

/**
 * Created by hzwangchenyan on 2017/12/27.
 */
public class UserManager {
    // 已注册的账号
    private Set<LoginInfo> loginInfos = new HashSet<>();

    private static class SingletonHolder {
        private static UserManager instance = new UserManager();
    }

    private UserManager() {

        for(int i=1;i<11;i++){
            LoginInfo wcy = new LoginInfo();
            wcy.setAccount("test"+i);
            wcy.setToken("123456");
            loginInfos.add(wcy);
        }
    }

    public static UserManager get() {
        return SingletonHolder.instance;
    }

    public boolean verify(LoginInfo loginInfo) {
//        for (LoginInfo info : loginInfos) {
////            if (info.equals(loginInfo)) {
//                return true;
////            }
//        }
        return true;
    }
}
